<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>leaves</title>
</head>
<body>
<form action="" method="get">

    <select name="status" id="status">
    {% if status == '-1' %}
        <option value="-1" selected>选择类型</option>
    {% else %}
        <option value="-1">选择类型</option>
    {% endif %}

        {% for leaf in leaves_type %}
            <option value="{{ leaf.id }}">{{ leaf.g_leave }}--({{ leaf.s_leave_set.all.count }})</option>

        {% endfor %}


    </select>
        <input type="submit" value="过滤">
            <table border="4">
                <tr>
                    <td style="text-align: center">编号</td>
                    <td style="text-align: center">姓名</td>
                    <td style="text-align: center">事由</td>
                    <td style="text-align: center">状态</td>
                    <td style="text-align: center">类型</td>
                    <td style="text-align: center">操作</td>

                </tr>
    {% for leaf1 in leaves %}
        <tr>
            <td>{{ leaf1.id }}&nbsp;&nbsp;</td>
            <td>{{ leaf1.stu_name }}&nbsp;&nbsp;</td>
            <td>{{ leaf1.context }}&nbsp;&nbsp;</td>
            <td>{{ leaf1.status }} {{ leaf1.get_status_display }}&nbsp;&nbsp;</td>
            <td>{{ leaf1.tid.g_leave }}&nbsp;&nbsp;</td>

            <td><a href="{% url 'go_leave:update_leaver' %}?id={{ leaf1.id }}&status=1">通过</a>
            <a href="{% url 'go_leave:update_leaver' %}?id={{ leaf1.id }}&status=2">不通过</a></td>

    <br>
    </tr>
{% endfor %}
</table>
</form>
{% if page > 1 %}
    <a href="{% url 'go_leave:show_leaver' %}?page={{ page|add:-1 }}&status={{ status }}">上一页</a>
{% endif %}
<b><a href="#">当前页{{ page }}</a></b>
{% if page < max  %}
    <a href="{% url 'go_leave:show_leaver' %}?page={{ page|add:1 }}&status={{ status }}">下一页</a>
{% endif %}

{#<a href="{% url 'go_leave:show_leaver' %}"></a>#}

</body>
</html>